package com.dawn.module.hospital.dal.mysql.medicalcopy;

import java.util.*;

import com.dawn.framework.common.pojo.PageResult;
import com.dawn.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.dawn.framework.mybatis.core.mapper.BaseMapperX;
import com.dawn.module.hospital.controller.admin.medicalcopy.vo.MedicalCopyPageReqVO;
import com.dawn.module.hospital.dal.dataobject.medicalcopy.MedicalCopyDO;
import org.apache.ibatis.annotations.Mapper;
import com.dawn.module.hospital.controller.app.medicalcopy.vo.*;

/**
 * 病案复印 Mapper
 *
 * @author root
 */
@Mapper
public interface MedicalCopyMapper extends BaseMapperX<MedicalCopyDO> {

    default PageResult<MedicalCopyDO> selectPage(MedicalCopyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MedicalCopyDO>()
                .eqIfPresent(MedicalCopyDO::getOrgId, reqVO.getOrgId())
                .eqIfPresent(MedicalCopyDO::getUserId, reqVO.getUserId())
                .eqIfPresent(MedicalCopyDO::getOpenid, reqVO.getOpenid())
                .likeIfPresent(MedicalCopyDO::getOrgName, reqVO.getOrgName())
                .eqIfPresent(MedicalCopyDO::getOrgCode, reqVO.getOrgCode())
                .eqIfPresent(MedicalCopyDO::getApplyNo, reqVO.getApplyNo())
                .eqIfPresent(MedicalCopyDO::getHomepageId, reqVO.getHomepageId())
                .betweenIfPresent(MedicalCopyDO::getLeaveHospitalDate, reqVO.getLeaveHospitalDate())
                .eqIfPresent(MedicalCopyDO::getLeaveHospitalDept, reqVO.getLeaveHospitalDept())
                .eqIfPresent(MedicalCopyDO::getLeaveHospitalCertificate, reqVO.getLeaveHospitalCertificate())
                .eqIfPresent(MedicalCopyDO::getHospitalNo, reqVO.getHospitalNo())
                .eqIfPresent(MedicalCopyDO::getMedicalType, reqVO.getMedicalType())
                .eqIfPresent(MedicalCopyDO::getPurpose, reqVO.getPurpose())
                .eqIfPresent(MedicalCopyDO::getContent, reqVO.getContent())
                .eqIfPresent(MedicalCopyDO::getRelation, reqVO.getRelation())
                .eqIfPresent(MedicalCopyDO::getPatientId, reqVO.getPatientId())
                .eqIfPresent(MedicalCopyDO::getPatientType, reqVO.getPatientType())
                .likeIfPresent(MedicalCopyDO::getPatientName, reqVO.getPatientName())
                .eqIfPresent(MedicalCopyDO::getPatientCardNo, reqVO.getPatientCardNo())
                .eqIfPresent(MedicalCopyDO::getPatientCardImgFront, reqVO.getPatientCardImgFront())
                .eqIfPresent(MedicalCopyDO::getPatientCardImgReverse, reqVO.getPatientCardImgReverse())
                .likeIfPresent(MedicalCopyDO::getApplicantName, reqVO.getApplicantName())
                .eqIfPresent(MedicalCopyDO::getApplicantCardNo, reqVO.getApplicantCardNo())
                .eqIfPresent(MedicalCopyDO::getApplicantCardImgFront, reqVO.getApplicantCardImgFront())
                .eqIfPresent(MedicalCopyDO::getApplicantCardImgReverse, reqVO.getApplicantCardImgReverse())
                .eqIfPresent(MedicalCopyDO::getOtherFile, reqVO.getOtherFile())
                .eqIfPresent(MedicalCopyDO::getCollectType, reqVO.getCollectType())
                .likeIfPresent(MedicalCopyDO::getRecipientName, reqVO.getRecipientName())
                .eqIfPresent(MedicalCopyDO::getRecipientPhone, reqVO.getRecipientPhone())
                .eqIfPresent(MedicalCopyDO::getRecipientAddress, reqVO.getRecipientAddress())
                .eqIfPresent(MedicalCopyDO::getDeliveryId, reqVO.getDeliveryId())
                .likeIfPresent(MedicalCopyDO::getDeliveryName, reqVO.getDeliveryName())
                .eqIfPresent(MedicalCopyDO::getDeliveryNo, reqVO.getDeliveryNo())
                .eqIfPresent(MedicalCopyDO::getOrderNumber, reqVO.getOrderNumber())
                .eqIfPresent(MedicalCopyDO::getThirdOrderNo, reqVO.getThirdOrderNo())
                .eqIfPresent(MedicalCopyDO::getTotalPrice, reqVO.getTotalPrice())
                .eqIfPresent(MedicalCopyDO::getMedicalPrice, reqVO.getMedicalPrice())
                .eqIfPresent(MedicalCopyDO::getPrintPrice, reqVO.getPrintPrice())
                .eqIfPresent(MedicalCopyDO::getPostagePrice, reqVO.getPostagePrice())
                .eqIfPresent(MedicalCopyDO::getServicePrice, reqVO.getServicePrice())
                .eqIfPresent(MedicalCopyDO::getOtherPrice, reqVO.getOtherPrice())
                .eqIfPresent(MedicalCopyDO::getPayStatus, reqVO.getPayStatus())
                .betweenIfPresent(MedicalCopyDO::getPayTime, reqVO.getPayTime())
                .eqIfPresent(MedicalCopyDO::getPayType, reqVO.getPayType())
                .eqIfPresent(MedicalCopyDO::getRefundNumber, reqVO.getRefundNumber())
                .eqIfPresent(MedicalCopyDO::getRefundPrice, reqVO.getRefundPrice())
                .betweenIfPresent(MedicalCopyDO::getRefundTime, reqVO.getRefundTime())
                .eqIfPresent(MedicalCopyDO::getRefundReason, reqVO.getRefundReason())
                .eqIfPresent(MedicalCopyDO::getExamine, reqVO.getExamine())
                .eqIfPresent(MedicalCopyDO::getRemark, reqVO.getRemark())
                .eqIfPresent(MedicalCopyDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(MedicalCopyDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(MedicalCopyDO::getPatientCardImgHandheld, reqVO.getPatientCardImgHandheld())
                .eqIfPresent(MedicalCopyDO::getApplicantCardImgHandheld, reqVO.getApplicantCardImgHandheld())
                .orderByDesc(MedicalCopyDO::getUpdateTime).orderByDesc(MedicalCopyDO::getId));
    }

}